/**
 * @Project : ProgrammingExercises
 * @Package : Leetcode
 * @File : Q2536.java
 * @Author : WangRuoyu
 * @Date 2023/1/28 10:40
 */

package leetcode;

import java.util.Arrays;

public class Q2536 {
    public int[][] rangeAddQueries(int n, int[][] queries) {
        int[][] res = new int[n][n];
        for (int[] querie : queries) {
            for (int i = querie[0]; i <= querie[2]; i++) {
                for (int j = querie[1]; j <= querie[3]; j++) {
                    res[i][j]++;
                }
            }
        }
        return res;
    }

    public static void main(String[] args) {
        Q2536 sl = new Q2536();
        int n = 3;
        int[][] queries = {{1, 1, 2, 2}, {0, 0, 1, 1}};
        for (int[] q : sl.rangeAddQueries(n, queries)) {
            System.out.println(Arrays.toString(q));
        }
    }
}